package com.boboPlanet.comm.thread;

import org.apache.commons.codec.digest.DigestUtils;

import java.util.UUID;

/**
 * @Description: TODO TraceId生成工具类
 * @Author: mis_wu
 * @Date: 2023/5/13
 * @Company planet
 **/
public class TraceIdAutoGenerate {

    public static String traceByUuid(){

        return UUID.randomUUID().toString().replaceAll("-", "");

    }

    public static String traceByMD5(){
        String uuid = UUID.randomUUID().toString();
        return DigestUtils.md5Hex(uuid).substring(8, 24);
    }
}
